<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CBD房屋租赁系统</title>

	<style type="text/css">
		body {
			background-color: #8ea4f8;
			background-image: url(../../images/background.jpg);
			background-repeat: no-repeat;
			background-size: cover; //背景图适应屏幕

		}
		.login_box {
			width: 400px;
			height: 400px;
			background-color: #fff;
			margin: auto;
			margin-top: 150px;
			border-radius: 5px;
			overflow: hidden;//.title设置margin-top无效，给父元素设置overflow:hidden;
		}
		.title {
			text-align: center;
			font-size: 28px;
			color: #000;
			margin-top: 80px;
			margin-bottom: 10px;
			letter-spacing: 3px;
			font-family: sans-serif;
		}
		.input_box {
			width: 300px;
			height: 30px;
			width: 300px;
			height: 40px;
			padding-left: 10px;
			margin-top: 20px;
			margin-left: 50px;
		}
		.button_box {
			width: 300px;
			height: 35px;
			width: 100px;
			height: 40px;
			margin-top: 20px;
			margin-left: 65px;
			border-radius: 5px;
			background-color: #64a9d9;
			cursor: pointer;
			color: #fff;
		}
		.logo_box {
			position: fixed;
			background-color: #fff;
			width: 100px;
			height: 100px;
			border-radius: 100px;
			top: 100px;
			left: 46%;
			border: solid 5px #A68364;
			text-align: center;
		}
		.logo_img {
			margin-top: 20px;

		}
		.lore {
			display: flex;
		}
	</style>
</head>
<body>
<div class="logo_box"><img class="logo_img" src="images/login_logo.png"></div>

<form class="login_box" id="loginform" action="logincheck.action" method="post">
	<h1 class="title">欢迎登录</h1>
	<div><input class="input_box" type="text" name="username" placeholder="用户名" ></div>

	<div><input class="input_box" type="password" name="password" placeholder="密码" ></div>

	<div align="center">
		<label class="radio inline">
			<input id="admin" type="radio" name="type" value="admin"  checked/> 管理员
		</label>
		<label class="radio inline">
			<input id="zuke" type="radio" name="type" value="zuke"  /> 租客
		</label>
		<br>
		<div class="lore">
			<button class="button_box" type="submit" id="login-button">登录</button>
</form>
<form action="/toRegister.action">
	<button class="button_box" type="submit" >注册</button>
</form>
</div>
</div>

<script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="/js/localization/messages_zh.js"></script>

<script type="text/javascript">


	 $().ready(function() {
        // 在键盘按下并释放及提交后验证提交表单
        $("#loginform").validate({
        	/*success:function(){
             //label.text('').addClass('valid');
            $('#login-button').click(function(event){
			event.preventDefault();
			$('form').fadeOut(500);
			$('.wrapper').addClass('form-success');

		});

        },*/
            rules : {
                username : {
                    required : true,
                },

                password : {
                    required : true,

                },

            },
            messages : {
                username : {
                    required : "",
                },

                password : {
                    required : "",

                },

            }
        });
    })

var error="${error}";
if(error=="error"){

alert("帐户名或密码错误");
}



</script>
</body>
</html>